import config from "@/config"
import http from "@/utils/request"

export default {
	info: {
		getMyTopicInfoListForApp:{
			url: `${config.API_URL}/get/topic/getMyTopicInfoListForApp`,
			name: "获取移动端企业专题新闻的列表",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		},
		getTopicInfoManageList: {
			url: `${config.API_URL}/get/topic/getTopicInfoManageList`,
			name: "获取专题新闻管理列表",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		},
		getMyTopicInfoList: {
			url: `${config.API_URL}/get/topic/getMyTopicInfoList`,
			name: "获取个人权限内的专题新闻",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		},
		update: {
			url: `${config.API_URL}/set/topic/updateTopicInfo`,
			name: "更新专题新闻",
			post: async function (data) {
				return await http.bigPost(this.url, data,
					{headers: {'Content-Type': 'multipart/form-data'}}
				);
			}
		},
		insert: {
			url: `${config.API_URL}/set/topic/insertTopicInfo`,
			name: "发布专题新闻",
			post: async function (data) {
				return await http.bigPost(this.url, data,
					{headers: {'Content-Type': 'multipart/form-data'}}
				);
			}
		},
		delete: {
			url: `${config.API_URL}/set/topic/deleteTopicInfo`,
			name: "删除专题新闻",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, {
					headers: {}
				});
			}
		},
		deleteTopicInfoByIds:{
			url: `${config.API_URL}/set/topic/deleteTopicInfoByIds`,
			name: "批量删除专题新闻",
			post: async function (data, config = {}) {
				return await http.post(this.url, data, {
					headers: {}
				});
			}
		},
		setTopicInfoReadStatus: {
			url: `${config.API_URL}/set/topic/setTopicInfoReadStatus`,
			name: "设置专题新闻查看状态",
			post: async function (params) {
				return await http.post(this.url,params);
			}
		},
		getMyPicTopicInfoListForDesk:{
			url: `${config.API_URL}/get/topic/getMyPicTopicInfoListForDesk`,
			name: "获取专题新闻图片",
			get: async function () {
				return await http.get(this.url);
			}
		},
		getMyTopicInfoListForDesk:{
			url: `${config.API_URL}/get/topic/getMyTopicInfoListForDesk`,
			name: "获取专题新闻图片",
			get: async function () {
				return await http.get(this.url);
			}
		},
		geTopicInfoReadStatus:{
			url: `${config.API_URL}/get/topic/geTopicInfoReadStatus`,
			name: "获取桌面专题新闻",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		},
		getMyTopicInfoById:{
			url: `${config.API_URL}/get/topic/getMyTopicInfoById`,
			name: "获取专题新闻详情",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		}
	},
	//专题栏目字典表
	topicDic:{
		getTopicDicTree: {
			url: `${config.API_URL}/get/topic/getTopicDicTree`,
			name: "获取专题栏目树",
			get: async function () {
				return await http.get(this.url);
			}
		},
		getTopicDicList: {
			url: `${config.API_URL}/get/topic/getTopicDicList`,
			name: "专题栏目明细",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		getTopicDicParentList: {
			url: `${config.API_URL}/get/topic/getTopicDicParentList`,
			name: "获取上级数据",
			get: async function (data) {
				return await http.get(this.url, data);
			}
		},
		getTopicDicChildList: {
			url: `${config.API_URL}/get/topic/getTopicDicChildList`,
			name: "根据父节点值获取数据",
			get: async function (data) {
				return await http.get(this.url, data);
			}
		},
		getTopicDicListByPatentId: {
			url: `${config.API_URL}/get/topic/getTopicDicListByPatentId`,
			name: "获取上级数据",
			get: async function (params) {
				return await http.get(this.url,params);
			}
		},
		insert: {
			url: `${config.API_URL}/set/topic/insertTopicDic`,
			name: "添加专题栏目",
			post: async function (data) { 
				return await http.post(this.url, data, {headers: {}});
			}
		},
		delete: {
			url: `${config.API_URL}/set/topic/deleteTopicDic`,
			name: "删除专题栏目",
			post: async function (data) {
				return await http.post(this.url, data, {headers: {}});
			}
		},
		dropTopicDic: {
			url: `${config.API_URL}/set/topic/dropTopicDic`,
			name: "专题栏目拖拽排序",
			post: async function (data) {
				return await http.post(this.url, data, {headers: {}});
			}
		},
		deleteTopicDicByIds: {
			url: `${config.API_URL}/set/topic/deleteTopicDicByIds`,
			name: "批量删除专题栏目",
			post: async function (data) {
				return await http.post(this.url, data, {headers: {}});
			}
		},
		update: {
			url: `${config.API_URL}/set/topic/updateTopicDic`,
			name: "更新专题栏目",
			post: async function (data) {
				return await http.post(this.url, data, {headers: {}});
			}
		},
		getTopicDicByCode: {
			url: `${config.API_URL}/get/topic/getTopicDicByCode`,
			name: "获取专题栏目数据",
			get: async function (data) {
				return await http.get(this.url, data);
			}
		}
	}
}
